package com.preguicoso.client.estabelecimento.cardapio.modelosItens;

import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.Widget;
import com.preguicoso.shared.entities.ItemCardapioBean;

public class BuildItem {

	private static BuildItem instance = null;
	public static BuildItem getInstance() {
		if (instance == null) {
		
				instance = new BuildItem();
		}
		return instance;
	}
	public BuildItem(){
		
	}
	public Widget getItem(ItemCardapioBean i) {
		Widget c;
		if(i.getTipo().toLowerCase().equals("pizza")){
			 c = new PizzaTipo(i);
		}else{
			c = new Tipo(i);
		}
		String[] token = History.getToken().split("/");
		c.setStyleName("cssStyle"+ token[1]);
		return c;
	}

}
